import request from '@/utils/request'

// 企业部门列表
export const getDepartment = () => request({
  method: 'get',
  url: '/company/department'
})
// 根据ID删除部门
export const delDepartment = (id) => request({
  method: 'DELETE',
  url: `/company/department/${id}`
})
// 新增部门
export const addDepartment = (data) => {
  return request({
    url: `/company/department`,
    method: 'post',
    data
  })
}
// 编辑部门
export const editDepartment = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
// 根据id拿到部门详情
export const getDepartmentDetails = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

